<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>GPIOTE abstraction</title>
<link href="tabs.css" rel="stylesheet" type="text/css" />
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="alias.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="alias.js"></script>

<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>


<script type="text/javascript">
  jQuery(document).ready(function () {
    if(gref){ // Number all _img and _table classes
      gref();
    }
  });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->

<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">nRF51 General Code Examples
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group__nrf__gpiote.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">GPIOTE abstraction</div>  </div>
<div class="ingroups"><a class="el" href="group__nrf__drivers.html">Drivers</a></div></div>
<div class="contents">

<p>GPIOTE abstraction for configuration of channels.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="enum-members"></a>
Enumerations</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nrf__gpiote.html#ga9a424db0997c11092f8f69d52155dd9d">nrf_gpiote_polarity_t</a> { <a class="el" href="group__nrf__gpiote.html#gga9a424db0997c11092f8f69d52155dd9da59dda358a841a81671bd372058b46498">NRF_GPIOTE_POLARITY_LOTOHI</a> =  GPIOTE_CONFIG_POLARITY_LoToHi, 
<a class="el" href="group__nrf__gpiote.html#gga9a424db0997c11092f8f69d52155dd9da97c193ac03f0691bea38c2283b55fa8a">NRF_GPIOTE_POLARITY_HITOLO</a> =  GPIOTE_CONFIG_POLARITY_HiToLo, 
<a class="el" href="group__nrf__gpiote.html#gga9a424db0997c11092f8f69d52155dd9da00487cd8286ff071ca751cd4a00295d5">NRF_GPIOTE_POLARITY_TOGGLE</a> =  GPIOTE_CONFIG_POLARITY_Toggle
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Polarity for GPIOTE channel enumerator.  <a href="group__nrf__gpiote.html#ga9a424db0997c11092f8f69d52155dd9d">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nrf__gpiote.html#gab280bbb7269ab98a97e7b47d906ef9aa">nrf_gpiote_outinit_t</a> { <a class="el" href="group__nrf__gpiote.html#ggab280bbb7269ab98a97e7b47d906ef9aaae0df1a0e930bfe3b198a9692d9916667">NRF_GPIOTE_INITIAL_VALUE_LOW</a> =  GPIOTE_CONFIG_OUTINIT_Low, 
<a class="el" href="group__nrf__gpiote.html#ggab280bbb7269ab98a97e7b47d906ef9aaa1fc9af8ce3fcd7165b3c090b564e9aa4">NRF_GPIOTE_INITIAL_VALUE_HIGH</a> =  GPIOTE_CONFIG_OUTINIT_High
 }</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Initial output value for GPIOTE channel enumerator.  <a href="group__nrf__gpiote.html#gab280bbb7269ab98a97e7b47d906ef9aa">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static __INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nrf__gpiote.html#gab8667667ddf3bdca874df3add96fb622">nrf_gpiote_task_config</a> (uint32_t channel_number, uint32_t pin_number, <a class="el" href="group__nrf__gpiote.html#ga9a424db0997c11092f8f69d52155dd9d">nrf_gpiote_polarity_t</a> polarity, <a class="el" href="group__nrf__gpiote.html#gab280bbb7269ab98a97e7b47d906ef9aa">nrf_gpiote_outinit_t</a> initial_value)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Config GPIOTE channel as output, setting the properly desired output level.  <a href="#gab8667667ddf3bdca874df3add96fb622"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static __INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nrf__gpiote.html#gac04dde3ea740f163fa2ac032bf56152d">nrf_gpiote_event_config</a> (uint32_t channel_number, uint32_t pin_number, <a class="el" href="group__nrf__gpiote.html#ga9a424db0997c11092f8f69d52155dd9d">nrf_gpiote_polarity_t</a> polarity)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Config GPIOTE channel as input, automatically clearing an event that appears in some cases nder configuration.  <a href="#gac04dde3ea740f163fa2ac032bf56152d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">static __INLINE void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__nrf__gpiote.html#gae721c9782910048854960a6db18ab2ef">nrf_gpiote_unconfig</a> (uint32_t channel_number)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Unconfig GPIOTE channel.  <a href="#gae721c9782910048854960a6db18ab2ef"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<p>GPIOTE abstraction for configuration of channels. </p>
<hr/><h2>Enumeration Type Documentation</h2>
<a class="anchor" id="ga9a424db0997c11092f8f69d52155dd9d"></a><!-- doxytag: member="nrf_gpiote.h::nrf_gpiote_polarity_t" ref="ga9a424db0997c11092f8f69d52155dd9d" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__nrf__gpiote.html#ga9a424db0997c11092f8f69d52155dd9d">nrf_gpiote_polarity_t</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Polarity for GPIOTE channel enumerator. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="gga9a424db0997c11092f8f69d52155dd9da59dda358a841a81671bd372058b46498"></a><!-- doxytag: member="NRF_GPIOTE_POLARITY_LOTOHI" ref="gga9a424db0997c11092f8f69d52155dd9da59dda358a841a81671bd372058b46498" args="" -->NRF_GPIOTE_POLARITY_LOTOHI</em>&nbsp;</td><td>
<p>Low to high. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga9a424db0997c11092f8f69d52155dd9da97c193ac03f0691bea38c2283b55fa8a"></a><!-- doxytag: member="NRF_GPIOTE_POLARITY_HITOLO" ref="gga9a424db0997c11092f8f69d52155dd9da97c193ac03f0691bea38c2283b55fa8a" args="" -->NRF_GPIOTE_POLARITY_HITOLO</em>&nbsp;</td><td>
<p>High to low. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="gga9a424db0997c11092f8f69d52155dd9da00487cd8286ff071ca751cd4a00295d5"></a><!-- doxytag: member="NRF_GPIOTE_POLARITY_TOGGLE" ref="gga9a424db0997c11092f8f69d52155dd9da00487cd8286ff071ca751cd4a00295d5" args="" -->NRF_GPIOTE_POLARITY_TOGGLE</em>&nbsp;</td><td>
<p>Toggle. </p>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="nrf__gpiote_8h_source.html#l00018">18</a> of file <a class="el" href="nrf__gpiote_8h_source.html">nrf_gpiote.h</a>.</p>

</div>
</div>
<a class="anchor" id="gab280bbb7269ab98a97e7b47d906ef9aa"></a><!-- doxytag: member="nrf_gpiote.h::nrf_gpiote_outinit_t" ref="gab280bbb7269ab98a97e7b47d906ef9aa" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__nrf__gpiote.html#gab280bbb7269ab98a97e7b47d906ef9aa">nrf_gpiote_outinit_t</a></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Initial output value for GPIOTE channel enumerator. </p>
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" id="ggab280bbb7269ab98a97e7b47d906ef9aaae0df1a0e930bfe3b198a9692d9916667"></a><!-- doxytag: member="NRF_GPIOTE_INITIAL_VALUE_LOW" ref="ggab280bbb7269ab98a97e7b47d906ef9aaae0df1a0e930bfe3b198a9692d9916667" args="" -->NRF_GPIOTE_INITIAL_VALUE_LOW</em>&nbsp;</td><td>
<p>Low to high. </p>
</td></tr>
<tr><td valign="top"><em><a class="anchor" id="ggab280bbb7269ab98a97e7b47d906ef9aaa1fc9af8ce3fcd7165b3c090b564e9aa4"></a><!-- doxytag: member="NRF_GPIOTE_INITIAL_VALUE_HIGH" ref="ggab280bbb7269ab98a97e7b47d906ef9aaa1fc9af8ce3fcd7165b3c090b564e9aa4" args="" -->NRF_GPIOTE_INITIAL_VALUE_HIGH</em>&nbsp;</td><td>
<p>High to low. </p>
</td></tr>
</table>
</dd>
</dl>

<p>Definition at line <a class="el" href="nrf__gpiote_8h_source.html#l00030">30</a> of file <a class="el" href="nrf__gpiote_8h_source.html">nrf_gpiote.h</a>.</p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gab8667667ddf3bdca874df3add96fb622"></a><!-- doxytag: member="nrf_gpiote.h::nrf_gpiote_task_config" ref="gab8667667ddf3bdca874df3add96fb622" args="(uint32_t channel_number, uint32_t pin_number, nrf_gpiote_polarity_t polarity, nrf_gpiote_outinit_t initial_value)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static __INLINE void nrf_gpiote_task_config </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>channel_number</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pin_number</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__nrf__gpiote.html#ga9a424db0997c11092f8f69d52155dd9d">nrf_gpiote_polarity_t</a>&#160;</td>
          <td class="paramname"><em>polarity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__nrf__gpiote.html#gab280bbb7269ab98a97e7b47d906ef9aa">nrf_gpiote_outinit_t</a>&#160;</td>
          <td class="paramname"><em>initial_value</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Config GPIOTE channel as output, setting the properly desired output level. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">channel_number</td><td>specifies the GPIOTE channel [0:3] to configure as an output channel. </td></tr>
    <tr><td class="paramname">pin_number</td><td>specifies the pin number [0:30] to use in the GPIOTE channel. </td></tr>
    <tr><td class="paramname">polarity</td><td>specifies the desired polarity in the output GPIOTE channel. </td></tr>
    <tr><td class="paramname">initial_value</td><td>specifies the initial value of the GPIOTE channel input after the channel configuration. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="nrf__gpiote_8h_source.html#l00046">46</a> of file <a class="el" href="nrf__gpiote_8h_source.html">nrf_gpiote.h</a>.</p>

</div>
</div>
<a class="anchor" id="gac04dde3ea740f163fa2ac032bf56152d"></a><!-- doxytag: member="nrf_gpiote.h::nrf_gpiote_event_config" ref="gac04dde3ea740f163fa2ac032bf56152d" args="(uint32_t channel_number, uint32_t pin_number, nrf_gpiote_polarity_t polarity)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static __INLINE void nrf_gpiote_event_config </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>channel_number</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>pin_number</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__nrf__gpiote.html#ga9a424db0997c11092f8f69d52155dd9d">nrf_gpiote_polarity_t</a>&#160;</td>
          <td class="paramname"><em>polarity</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Config GPIOTE channel as input, automatically clearing an event that appears in some cases nder configuration. </p>
<p>Note that the pin must be configured as connected input for this function to have any effect.</p>
<p>Note that when configuring the channel as input an event might be triggered. Care of disabling interrupts for that channel is left to the user.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">channel_number</td><td>specifies the GPIOTE channel [0:3] to configure as an input channel. </td></tr>
    <tr><td class="paramname">pin_number</td><td>specifies the pin number [0:30] to use in the GPIOTE channel. </td></tr>
    <tr><td class="paramname">polarity</td><td>specifies the desired polarity in the output GPIOTE channel. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="nrf__gpiote_8h_source.html#l00098">98</a> of file <a class="el" href="nrf__gpiote_8h_source.html">nrf_gpiote.h</a>.</p>

</div>
</div>
<a class="anchor" id="gae721c9782910048854960a6db18ab2ef"></a><!-- doxytag: member="nrf_gpiote.h::nrf_gpiote_unconfig" ref="gae721c9782910048854960a6db18ab2ef" args="(uint32_t channel_number)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static __INLINE void nrf_gpiote_unconfig </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>channel_number</em></td><td>)</td>
          <td><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Unconfig GPIOTE channel. </p>
<p>Note that when unconfiguring the channel, the pin is configured as GPIO PIN_CNF configuration.</p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">channel_number</td><td>specifies the GPIOTE channel [0:3] to unconfigure. </td></tr>
  </table>
  </dd>
</dl>

<p>Definition at line <a class="el" href="nrf__gpiote_8h_source.html#l00123">123</a> of file <a class="el" href="nrf__gpiote_8h_source.html">nrf_gpiote.h</a>.</p>

</div>
</div>
</div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">
      Copyright &copy 2006-2011 <a href="http://www.nordicsemi.no" style="text-decoration:none">Nordic Semiconductor</a>.
      All Rights Reserved.
      <a href="disclaimer.html">Disclaimer</a>
    </li>
   </ul>
 </div>


</body>
</html>
